import { createStore, applyMiddleware } from 'redux'
import Reducer  from './reducers'
import thunk from 'redux-thunk'
//异步处理中间件
import promiseMiddleware from 'redux-promise-middleware'
import createLogger from 'redux-logger'
// 安装redux-devtools-extension的可视化工具。需去谷歌商店安装Redux-DevTools
import { composeWithDevTools } from 'redux-devtools-extension'
const StoreConfig=() => {
  return createStore<any, any, any, any>(
    Reducer,
    composeWithDevTools(applyMiddleware(thunk, promiseMiddleware(), createLogger))
  )
}

export default StoreConfig